package de.game.actor.creep;

import java.awt.image.BufferedImage;

import de.core.gameplay.actor.AbstractMovingActor;

public abstract class AbstractCreep extends AbstractMovingActor {

    private final long healthPoints;

    private double currentHealthPoints;


    protected AbstractCreep(BufferedImage aImage, long aHealth, double aSpeed, int aX, int aY) {
        super(aImage, aSpeed, aX, aY);
        healthPoints = aHealth;

        currentHealthPoints = healthPoints;
    }

    @Override
    public void updateGameState() {
        if (currentHealthPoints <= 0) {
            removeFromLevel();
            return;
        }
        super.updateGameState();
    }

    public void addDamage(double aDamagePoints) {
        currentHealthPoints -= aDamagePoints;
    }

    public double getCurrentHealtPoints() {
        return currentHealthPoints;
    }

}
